package day3.Exer;

public class Company {
    String name;
    String adress;
    String telephone;
    String scope;
    String[] staff = new String[500];

    public void add(String stname) {
        for (int i = 0; i < staff.length; i++) {
            if (staff[i] == null) {
                staff[i] = stname;
                break;
            }
        }
    }

    public void showstaff() {
        for (int i = 0; ; i++) {
            if (staff[i] == null) {
                break;
            }
            System.out.print(staff[i] + "\t");
        }
        System.out.println();
    }

    public void dismiss(String disname) {
        String[] staff2 = new String[staff.length - 1];
        int index = 0;
        staff[index] = disname;
        for (int i = index; i < staff.length; i++) {
            if (staff[i].equals(disname)) {
                System.out.println(disname + "已被删除");
            }
            staff[i] = staff[i + 1];
            if (staff[i] == null) {
                break;
            }
        }

    }
}

